package cn.datawin.sms.cmpp2;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

@Data
@TableName("cmpp_sms_detail_log")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "cmpp短信日志")
public class SmsDetailLog extends Model<SmsDetailLog> {


	/**
	 * ID
	 */
	@TableId(type = IdType.ASSIGN_ID)
	@Schema(description="ID")
	private Long id;

    private String protocolTypeCode;
    private String messageTypeCode;
    private String sourceIp;


    private String subCode;
    private String charset;
    //客户报告msgid
    private String crMsgId;
    private String msgBatchNo;
    private String countryCode;


    //用户短信日志
    private String userMsgId;
    private int userSequence;
    private short userPkTotal;
    private short userPkNumber;
    private short userTpudhi;
    private short userMsgLen;

	//接入服务器的tag（cmpp-server http-server 等等）
	private String accessServerTag;
	//输出服务器的tag（cmpp-client sgip-client 等）
	private String outputServerTag;

//    private Integer isResend;
//    private String originCrMsgId;
//    private String originId;

	/**
	 * 短信内容
	 */
	private String content;
	/**
	 * 手机号
	 */
	private String phoneNos;

	/**
	 * 客户id
	 */
	private Long cstmCustomerId;
	/**
	 * 客户code
	 */
	private String cstmCustomerCode;
	/**
	 * 客户单价
	 */
	private BigDecimal price;

    /**
     * 运营商
     */
    private String ispCode;
    /**
     * 归属省
     */
    private String province;
    /**
     * 城市
     */
    private String city;

    /**
     * 年月日
     */
    private String ymd;


	/**
	 * 输入时间 (cmpp服务接收到下游短信的时间)
	 */
	private Date inputDate;
	/**
	 * 受理时间 (队列接收到消息)
	 */
	private Date acceptTime;

	/**
	 * 拦截状态 0 未拦截 1 已拦截
	 */
	private Integer interruptStatus;

	/**
	 * 提交上游响应状态 0 未提交 1 提交成功 2 提交失败
	 */
	private Integer submitStatus;
	/**
	 * client接收到队列中消息的时间
	 */
	private Date submitDate;
	//submitStatus=0 result
	private Integer submitResult;
	private Date submitResponseDate;
	private String submitDescription;
	private String senderLocalIP;
	private String channelMsgId;
	private String groupCode;
	private String senderLocalPort;
	private String signature;
	private Integer sequence;
	private Integer contentLength;
	private String sPNumber;

	/**
	 * 单号码计费条数
	 */
	private Integer deductions;
	/**
	 * 上游供应商id
	 */
	private String provProviderId;

	/**
	 * 上游供应商code
	 */
	private String provProviderCode;
	/**
	 * 上游供应商spCode
	 */
	private String provProviderSpCode;

	/**
	 * 上游供应商通道id
	 */
	private String provProviderChannelId;

	/**
	 * 通道单价
	 */
	private BigDecimal channelPrice;


	/**
	 * 回执状态 0 未回执 1 成功 2 上游回执失败 3 （黑名单等）通道拦截失败回执 4 超时回执失败 5 上游连接异常的回执失败
	 */
	private Integer reportStatus;
	/**
	 * 回执时间（短短信）
	 */
	private Date reportTime;
	/**
	 * 回执状态码（短短信）
	 */
	private String reportStatusText;


	public void setSubmitDate(Date submitDate) {
		this.submitDate = submitDate;
	}

	public Date getSubmitDate() {
		return submitDate;
	}
}
